package cn.bb.pojo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.io.Serializable;
@Component("computer")
@Scope("prototype")//prototype多例模式   singleton单例模式
public class Computer implements Serializable {
    @Resource
    private MainFrame mainFrame;
    @Resource(name = "lg")
    private Display display;

    public void printlnComputerInfo(){
        System.out.println("计算机的配置");
        mainFrame.printlnModelType();//主机
        display.printlnDisplayInfo();//显示器
    }

    public MainFrame getMainFrame() {
        return mainFrame;
    }

    public void setMainFrame(MainFrame mainFrame) {
        this.mainFrame = mainFrame;
    }

    public Display getDisplay() {
        return display;
    }

    public void setDisplay(Display display) {
        this.display = display;
    }
}
